package com.jxwifi.cloud.quickclean.adapter;

import android.support.annotation.LayoutRes;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.idroid.widget.CircleImageView;
import com.jxwifi.cloud.quickclean.R;

public class JoinAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public JoinAdapter(@LayoutRes int layoutResId) {
        super(layoutResId, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        if(item == null){
            return;
        }
        if (!"data_null".equals(item.toString())){
            Glide.with(mContext).load(item.toString()).error(R.mipmap.avatar).into((CircleImageView) helper.getView(R.id.img_join_photo));
        }else{
            Glide.with(mContext).load(R.mipmap.avatar).into((CircleImageView) helper.getView(R.id.img_join_photo));
        }

        //shap_with_bg img_join_photo
//        if (helper.getLayoutPosition() == mAreaindex) {
//            helper.setBackgroundRes(R.id.rel_area_list_item, R.drawable.shap_with_bg_un);
//        } else {
//            helper.setBackgroundRes(R.id.rel_area_list_item, R.drawable.shap_with_bg);
//        }
//        helper.setText(R.id.tv_pop_list_area, item.getArea());
//        helper.setText(R.id.tv_pop_list_area_center, item.getDescription());
        //helper.setText(R.id.tv_pop_list_assem,item.getOptionName());

    }
}
